﻿namespace FastapiBlazorBlog
{
    /// <summary>
    /// 工具类
    /// </summary>
    public static class Utils
    {
        /// <summary>
        /// Unix时间戳转DateTime
        /// </summary>
        /// <param name="unixTimeStamp"></param>
        /// <returns></returns>
        public static DateTime UnixTimeStampToDateTime(double unixTimeStamp)
        {
            var utc0 = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
            var dateTime = utc0.AddSeconds(unixTimeStamp).ToLocalTime();
            return dateTime;
        }

        // 请求基础uri
        public static string BASE_URL { get; set; } = "http://127.0.0.1:7788";
    }
}
